<script>
import { mapMutations, mapActions } from 'vuex';
import Cache from '@/utils/cache';
import { strToParams, showModal, setTabbar } from '@/utils/tools';
import { wxMnpLogin } from '@/utils/login';
// import { initRequest } from '@/api/index.js';

export default {
	globalData: {
		navHeight: ''
	},
	onLaunch: async function (options) {
		// initRequest(this);
		uni.hideTabBar({
			animation: false
		});
		// 获取配置
		this.getConfigFun();
	},
	onShow: function (options) {
		//绑定邀请码
	},
	onHide: function () {
		console.log('App Hide');
	},
	methods: {
		...mapMutations(['SETCONFIG']),
		async getConfigFun() {
			try {
				const { code, data } = await getConfig();
				if (code == 1) {
					this.SETCONFIG(data);

					setTabbar();
				}
			} catch (e) {
				uni.showTabBar();
			}
		}
	}
};
</script>

<style lang="scss">
@import 'styles/base.scss';
/*每个页面公共css */
@import 'components/uview-ui/index.scss';

.add-load {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}
.load-more {
	padding: 30rpx 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #999;
	font-size: 26rpx;

	.load-text {
		margin-top: 15rpx;
	}
}
.app-bottom {
	padding-bottom: 150rpx;
}
.flex {
	display: flex;
}
.align-center {
	align-items: center;
}
.flex-center {
	justify-content: center;
}
.flex-around {
	justify-content: space-around;
}

.flex-between {
	justify-content: space-between;
}
.flex-column {
	flex-direction: column;
}

.mb-50 {
	margin-bottom: 50rpx;
}
.mt-30 {
	margin-top: 30rpx;
}

.rxsp-img {
	image {
		width: 140rpx;
		height: 60rpx;
	}
	position: absolute;
	top: -21rpx;
	right: -120rpx;
}
.subsidized-goods {
	image {
		width: 94rpx;
		height: 30rpx;
	}
	display: flex;
	align-items: center;
	margin-right: 10rpx;
}
.rxsp-image {
	image {
		width: 140rpx;
		height: 60rpx;
	}
}
.jtsp-image {
	image {
		width: 94rpx;
		height: 30rpx;
	}
}
</style>
